﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class SysCfg
    {
        /// <summary>
        /// 设备类型
        /// </summary>
        public static string DBStr => GetDBStr();
        //public static string DBStr => ConfigurationUtil.GetConfiguration(Convert.ToString, () => "Server=.;DataBase=DataD_qianjian;User Id=sa;Password=123456;TrustServerCertificate=true;Pooling=true;Min Pool Size=1");


        private static string GetDBStr()
        {
            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "XW.ini"))
            {
                return ConfigurationUtil.GetConfiguration(Convert.ToString, () => "Server=127.0.0.1\\data;DataBase=DataD;User Id=sa;Password=123456;TrustServerCertificate=true;Pooling=true;Min Pool Size=1");
            }
            else
            {
                return ConfigurationUtil.GetConfiguration(Convert.ToString, () => "Server=127.0.0.1;DataBase=DataD;User Id=sa;Password=123456;TrustServerCertificate=true;Pooling=true;Min Pool Size=1");
            }
        }

    }
}